<div class="breadcrumb breadcrumbs">
  <div class="breadcrumb-trail">
    <span class="trail-before">当前位置:</span>
    <%= link_to "首页", root_path %>
    <span class="sep">/</span>
    <%= link_to "所有分类", shops_path %>
    <% unless @shop.category.nil? %>
    <span class="sep">/</span>
    <%= link_to @shop.category.name, category_shops_path(@shop.category) %>
    <% end %>
    <span class="sep">/</span>
    <span class="trail-end"><%= @shop.name %></span>
  </div>
</div>

<div id="content">
  <div class="hfeed">
    <div id="shop-<%= @shop.id %>" class="hentry shop publish">
      <h1 class="post-title entry-title"><%= link_to @shop.name, shop_path(@shop), :title => @shop.name %></h1>
      <div class="byline">
        更新时间: <%= @shop.updated_at %>
      </div>
      <div class="entry-content">
        <%= link_to image_tag(@shop.logo_link, :alt => "#{@shop.name}-LOGO", :class => 'thumbnail'), @shop.shop_link, :class => "shopid-#{@shop.id}", :target => '_blank', :title => "#{@shop.name}-淘宝旗舰店" %>
        <table style="width: 420px;">
          <tr>
            <th>名称</th>
            <th>属性</th>
          </tr>
          <tr>
            <td>总销量</td>
            <td><%= @shop.total_sales %></td>
          </tr>
          <tr>
            <td>主营行业</td>
            <td><%= link_to @shop.category.name, category_shops_path(@shop.category) unless @shop.category.nil? %></td>
          </tr>
          <tr>
            <td>地区</td>
            <td><%= "#{@shop.province.try :name}#{@shop.city.try :name}" %></td>
          </tr>
          <tr>
            <td>公司名称</td>
            <td><%= @shop.company_name %></td>
          </tr>
          <tr>
            <td>官方店铺</td>
            <td><%= link_to "#{@shop.name}-淘宝旗舰店", @shop.shop_link, :class => "shopid-#{@shop.id}", :title => "#{@shop.name}-淘宝旗舰店", :target => '_blank' %></td>
          </tr>
        </table>
        <h6>描述</h6>
        <p>
          <%= @shop.description %>
        </p>
        <h6><%= @shop.name %>品牌热卖商品</h6>
        <% if @shop.merchandises.count > 0 %>
        <div class="gallery">
          <div class="gallery-row clear">
            <% @shop.merchandises.each do |merchandise| %>
              <%= render :partial => "merchandise", :object => merchandise %>
            <% end %>
          </div>
        </div>
        <% else %>
          <p>
            暂无热卖商品数据
          </p>
        <% end %>
      </div>
      <div class="entry-meta">
        <span class="shop-tag">
          <span class="before">标签</span>
          <% @shop.tags.each do |tag| %>
            <%= link_to tag.name, tag_shops_path(:name => tag.name ) %>
          <% end %>
        </span>
      </div>
    </div>
  </div>
  
</div>

<div id="sidebar-secondary" class="sidebar">
  <%= render :partial => "search" %>
  <%= render :partial => "hot", :locals => {:shops => Shop.money.osales.limit(15), :hot_ckey => "hot/show"} %>
</div>

<%= render :partial => "/main/prom", :locals => {:shops => [@shop]} %>
